// Input Icon 输入框图标

// Config
$e-input-icon: (
	default: (
		width: 3.2rem,
		font-size: (
			flaticon: 1.3em,
			fontawesome: 1.2em,
			lineawesome: 1.4em
		)
	),
	lg: (
		width: 4.2rem,
		font-size: (
			flaticon: 1.4em,
			fontawesome: 1.3em,
			lineawesome: 1.6em
		)
	),
	sm: (
		width: 2.7rem,
		font-size: (
			flaticon: 1em,
			fontawesome: 1em,
			lineawesome: 1.1em
		)
	)
);

// Base
.e-input-icon {
    position: relative;
    padding: 0;
    width: 100%;

    > .e-input-icon-icon {
        position: absolute;
        height: 100%;
        display: flex;
        justify-content: center;
        top: 0;
        width: e-get($e-input-icon, default, width);

        &.e-input-icon-icon--left {
            left: 0;
        }

        &.e-input-icon-icon--right {
            right: 0;
        }

        > span {
            display: flex;
            align-items: center;    
            justify-content: center;
            height: 100%;

            i {
                display: flex;
                align-items: center;    
                justify-content: center;
                line-height: 0;
                color: e-base-color(label, 2);
            }
        }

        // 图标尺寸
        @include e-icons-size( e-get($e-input-icon, default, font-size) );
    }

    .form-control.form-control-lg + .e-input-icon-icon {
        width: e-get($e-input-icon, lg, width);

        // 图标尺寸
        @include e-icons-size( e-get($e-input-icon, lg, font-size) );
    }

    .form-control.form-control-sm ~ .e-input-icon-icon {
        width: e-get($e-input-icon, sm, width);

        // 图标尺寸
        @include e-icons-size( e-get($e-input-icon, sm, font-size) );
    }

    // 图标对齐方式
    &.e-input-icon--left {
        .form-control {
            padding-left: (e-get($e-input-icon, default, width) - .4rem);

            &.form-control-lg {
                padding-left: (e-get($e-input-icon, lg, width) - .6rem);
            }

            &.form-control-sm {
                padding-left: (e-get($e-input-icon, sm, width) - .2rem);
            }
        }
    }

    &.e-input-icon--right {
        .form-control {
            padding-right: (e-get($e-input-icon, default, width) - .4rem);

            &.form-control-lg {
                padding-right: (e-get($e-input-icon, lg, width) - .6rem);
            }

            &.form-control-sm {
                padding-right: (e-get($e-input-icon, sm, width) - .2rem);
            }
        }
    }
}